<?php
  include_once("./libraries/util.inc.php");
  include_once("./libraries/authentication.inc.php");

  session_start();

  sessionAuthenticate("login.php");

  printHeader();
  printBody();
  echo "<h2>",appName," Change Password Page</h2>"
?>

  <form method="POST" action="./changePasswordCheck.php">

  <table>
    <tr><td>Enter your current password:</td>
        <td><input type="password" size=10 maxlength=10 name="chgPassOrig"></td>
    </tr>
    <?php
      if(isset($_SESSION["pwdErrors"]["Orig"])) {
        echo "<tr><td><font color='red'>{$_SESSION["pwdErrors"]["Orig"]}</font></td></tr>";
      }
    ?>
    <tr><td>Enter your new password:</td>
        <td><input type="password" size=10 maxlength=10 name="chgPassNew1"></td>
    </tr>
    <?php
      if(isset($_SESSION["pwdErrors"]["New1"])) {
        echo "<tr><td><font color='red'>{$_SESSION["pwdErrors"]["New1"]}</font></td></tr>";
      }
    ?>
    <tr><td>Re-enter your new password:</td>
        <td><input type="password" size=10 maxLength=10 name="chgPassNew2"></td>
    </tr>
  </table>
  <p><input type="submit" value="Change My Password">
  </form>

  <?php
    if(isset($_SESSION["message"])) {
      echo "<br><font color='red'>{$_SESSION["message"]}</font>";
      unset($_SESSION["message"]);
    }
  ?>
  <br><a href="logout.php">Logout</a>

<?php
  printFooter();
?>
